/*
 * tty.h
 *
 *  Created on: 2016-10-27
 *      Author: m
 */

#ifndef SRC_INCLUDE_KERNEL_TTY_H_
#define SRC_INCLUDE_KERNEL_TTY_H_

#include "type.h"
#include "console.h"
#include "q.h"

#define CRTC_ADDR_REG       0x3D4
#define CRTC_DATA_REG       0x3D5
#define CURSOR_H            0xE
#define CURSOR_L            0xF
#define START_ADDR_H_REG    0xC
#define START_ADDR_L_REG    0xD

#define TTY_IN_BYTE_COUNT (1024)

typedef struct _tty {
    Q           q;
    CONSOLE*    console;
} TTY;


void init_tty();
void tty_read(TTY* tty);
void tty_write(TTY* tty);
void tty_task();

#endif /* SRC_INCLUDE_KERNEL_TTY_H_ */
